#pragma once
#include "StdAfx.h"
#include "GameOverAction.h"
#include "Controller.h"
#include "EntityControl.h"
#include "StackAllocator.h"
#include "StackAllocatorManager.h"
#include "IStackAllocator.h"

//class EntityControl;

GameOverAction::GameOverAction(void)
{
	deleted = false;

	//for(int i=0; i<2000; i++)
	//{
	//	testArray[i] = i;
	//	testArray2[i] = i/56.2453525;
	//	testArray3[i] = i*100000;
	//	/*testArray4[i] = 2000-i;
	//	testArray5[i] = i/5453.325;
	//	testArray6[i] = i*-100000;*/
	//}


}


GameOverAction::~GameOverAction(void)
{
	deleted = true;
}

void* GameOverAction::operator new (size_t size)
{
	return  StackAllocatorManager::getSingleton().allocateObject<GameOverAction>("GameOverAction",10);
}


void GameOverAction::operator delete (void *currentAction)
{
	StackAllocatorManager::getSingleton().freeObject<GameOverAction>("GameOverAction",((GameOverAction*)currentAction));
}



bool GameOverAction::FireTrigger(EntityControl *entity)
{
	std::vector<Controller*> *controllers = entity->getControllers();
	
	/*for(int i=0; i<controllers->size(); i++)
	{
		controllers->at(i)->GameOverMan();
	}*/

	entity->GameOverMan();


	
	return true;
}